package cn.itsource.ldj.util;

import java.io.Serializable;

public class AjaxResult {
	
	private Boolean success = true;
	private String msg = "操作成功";
	private Object resultObj;
	private Serializable sessionId;

	/* 默认成功 */
	public AjaxResult(){}

	/* 失败调用 */
	public AjaxResult(String msg) {
		this.success = false;
		this.msg = msg;
	}
	
	public Boolean getSuccess() {
		return success;
	}

	public Object getResultObj() {
		return resultObj;
	}

	/* 链式编程 */
	public AjaxResult setResultObj(Object resultObj) {
		this.resultObj = resultObj;
		return this;
	}

	public Serializable getSessionId() {
		return sessionId;
	}

	public void setSessionId(Serializable sessionId) {
		this.sessionId = sessionId;
	}

	public AjaxResult setSuccess(Boolean success) {
		this.success = success;
		return this;
	}
	public String getMsg() {
		return msg;
	}
	public AjaxResult setMsg(String msg) {
		this.msg = msg;
		return this;
	}

	public static AjaxResult me() {
		return new AjaxResult();
	}
}
